#!/bin/sh
# redshiftgui_tray - Part of wrapper for RedshiftGUI (redshiftgui)
# Points menu item to wtapper.
# Automatic minimized startup only if a location other than 0:0 specified.

if which redshiftgui &>/dev/null; then
	if grep -qsE 'Exec=redshiftgui$' \
	  /usr/share/applications/redshiftgui.desktop; then
		sed -i 's/Exec=redshiftgui$/&.sh/' \
		  /usr/share/applications/redshiftgui.desktop
		fixmenus
	fi
	if [ -f ~/.redshiftgrc ] \
	  && ! grep 'latlon=' ~/.redshiftgrc | grep -q '0.000000:0.000000' ~/.redshiftgrc; then
		exec redshiftgui.sh  --min
	fi
fi
